package com.yunyike.service.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yunyike.mapper.ShopBrandMapper;
import com.yunyike.model.ShopBrand;
import com.yunyike.service.IShopBrandService;

@Service("shopBrandServiceImpl")
public class ShopBrandServiceImpl implements IShopBrandService{

	private Logger log = LoggerFactory.getLogger(ShopBrandServiceImpl.class);

	@Autowired
	private ShopBrandMapper ShopBrandMapper;
	
	public int addShopBrand(ShopBrand shopBrand) {
		
		log.info("----->> add ShopBrand....");
		
		int result = 0;
		try {
			result = ShopBrandMapper.insert(shopBrand);
		} catch (Exception e) {
			log.info("add ShopBrand has errors,message:"+e.getMessage(),e);
		}
		
		log.info("add ShopBrand end .result:"+result+"<<----");
		
		return result;
	}

	/**
	 * 获取所有品牌
	 */
	public List<ShopBrand> findAllShopBrands() {
		return ShopBrandMapper.findAllShopBrands();
	}

}
